<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>octant.grid.CGrid</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="octant-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="octant-module.html">Package&nbsp;octant</a> ::
        <a href="octant.grid-module.html">Module&nbsp;grid</a> ::
        Class&nbsp;CGrid
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
      </table>
    </td>
  </tr>
</table>
<!-- ==================== TYPE DESCRIPTION ==================== -->
<h1 class="epydoc">type CGrid</h1><p class="nomargin-top"><span class="codelink"><a href="octant.grid-pysrc.html#CGrid">source&nbsp;code</a></span></p>
<pre class="base-tree">
object --+
         |
        <strong class="uidshort">CGrid</strong>
</pre>

<dl><dt>Known Subclasses:</dt>
<dd>
      <ul class="subclass-list">
<li><a href="octant.grid.CGrid_geo-class.html">CGrid_geo</a></li><li>, <a href="octant.grid.Gridgen-class.html">Gridgen</a></li>  </ul>
</dd></dl>

<hr />
<p>Curvilinear Arakawa C-Grid</p>
<p>The basis for the CGrid class are two arrays defining the verticies of the
grid in Cartesian (for geographic coordinates, see CGrid_geo). An optional
mask may be defined on the cell centers. Other Arakawa C-grid properties,
such as the locations of the cell centers (rho-points), cell edges (u and
v velocity points), cell widths (dx and dy) and other metrics (angle,
dmde, and dndx) are all calculated internally from the vertex points.</p>
<p>Input vertex arrays may be either type np.array or np.ma.MaskedArray. If
masked arrays are used, the mask will be a combination of the specified
mask (if given) and the masked locations.</p>
<div class="rst-section">
<h1 class="heading"><a id="rst-examples" name="rst-examples">EXAMPLES:</a></h1>
<pre class="py-doctest">
<span class="py-prompt">&gt;&gt;&gt; </span>x, y = mgrid[0.0:7.0, 0.0:8.0]
<span class="py-prompt">&gt;&gt;&gt; </span>x = np.ma.masked_where( (x&lt;3) &amp; (y&lt;3), x)
<span class="py-prompt">&gt;&gt;&gt; </span>y = np.ma.MaskedArray(y, x.mask)
<span class="py-prompt">&gt;&gt;&gt; </span>grd = octant.grid.CGrid(x, y)
<span class="py-prompt">&gt;&gt;&gt; </span><span class="py-keyword">print</span> grd.x_rho
<span class="py-output">[[-- -- -- 0.5 0.5 0.5 0.5]</span>
<span class="py-output"> [-- -- -- 1.5 1.5 1.5 1.5]</span>
<span class="py-output"> [-- -- -- 2.5 2.5 2.5 2.5]</span>
<span class="py-output"> [3.5 3.5 3.5 3.5 3.5 3.5 3.5]</span>
<span class="py-output"> [4.5 4.5 4.5 4.5 4.5 4.5 4.5]</span>
<span class="py-output"> [5.5 5.5 5.5 5.5 5.5 5.5 5.5]]</span>
<span class="py-output"></span><span class="py-prompt">&gt;&gt;&gt; </span><span class="py-keyword">print</span> grd.mask
<span class="py-output">[[ 0.  0.  0.  1.  1.  1.  1.]</span>
<span class="py-output"> [ 0.  0.  0.  1.  1.  1.  1.]</span>
<span class="py-output"> [ 0.  0.  0.  1.  1.  1.  1.]</span>
<span class="py-output"> [ 1.  1.  1.  1.  1.  1.  1.]</span>
<span class="py-output"> [ 1.  1.  1.  1.  1.  1.  1.]</span>
<span class="py-output"> [ 1.  1.  1.  1.  1.  1.  1.]]</span></pre>
</div>

<!-- ==================== INSTANCE METHODS ==================== -->
<a name="section-InstanceMethods"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td align="left" colspan="2" class="table-header">
    <span class="table-header">Instance Methods</span></td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="octant.grid.CGrid-class.html#__init__" class="summary-sig-name">__init__</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">x</span>,
        <span class="summary-sig-arg">y</span>)</span></td>
          <td align="right" valign="top">
            <span class="codelink"><a href="octant.grid-pysrc.html#CGrid.__init__">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="calculate_orthogonality"></a><span class="summary-sig-name">calculate_orthogonality</span>(<span class="summary-sig-arg">self</span>)</span><br />
      Calculate orthogonality error in radians</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="octant.grid-pysrc.html#CGrid.calculate_orthogonality">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="octant.grid.CGrid-class.html#mask_polygon" class="summary-sig-name">mask_polygon</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">polyverts</span>,
        <span class="summary-sig-arg">mask_value</span>=<span class="summary-sig-default">0.0</span>)</span><br />
      Mask Cartesian points contained within the polygon defined by polyverts</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="octant.grid-pysrc.html#CGrid.mask_polygon">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
</table>
<!-- ==================== PROPERTIES ==================== -->
<a name="section-Properties"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td align="left" colspan="2" class="table-header">
    <span class="table-header">Properties</span></td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="octant.grid.CGrid-class.html#mask" class="summary-name">mask</a><br />
      Return mask_rho
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="octant.grid.CGrid-class.html#mask_psi" class="summary-name">mask_psi</a><br />
      Return mask_psi
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="octant.grid.CGrid-class.html#mask_u" class="summary-name">mask_u</a><br />
      Return mask_u
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="octant.grid.CGrid-class.html#mask_v" class="summary-name">mask_v</a><br />
      Return mask_v
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="octant.grid.CGrid-class.html#x" class="summary-name">x</a><br />
      Return x_vert
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="octant.grid.CGrid-class.html#y" class="summary-name">y</a><br />
      Return x_vert
    </td>
  </tr>
</table>
<!-- ==================== METHOD DETAILS ==================== -->
<a name="section-MethodDetails"></a>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td align="left" colspan="2" class="table-header">
    <span class="table-header">Method Details</span></td>
</tr>
</table>
<a name="__init__"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">x</span>,
        <span class="sig-arg">y</span>)</span>
    <br /><em class="fname">(Constructor)</em>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="octant.grid-pysrc.html#CGrid.__init__">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  
  <dl class="fields">
    <dt>Overrides:
        object.__init__
        <dd><em class="note">(inherited documentation)</em></dd>
    </dt>
  </dl>
</td></tr></table>
</div>
<a name="mask_polygon"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">mask_polygon</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">polyverts</span>,
        <span class="sig-arg">mask_value</span>=<span class="sig-default">0.0</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="octant.grid-pysrc.html#CGrid.mask_polygon">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Mask Cartesian points contained within the polygon defined by polyverts</p>
<p>A cell is masked if the cell center (x_rho, y_rho) is within the
polygon. Other sub-masks (mask_u, mask_v, and mask_psi) are updated
automatically.</p>
<p>mask_value [=0.0] may be specified to alter the value of the mask set
within the polygon.  E.g., mask_value=1 for water points.</p>
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<br />
<!-- ==================== PROPERTY DETAILS ==================== -->
<a name="section-PropertyDetails"></a>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td align="left" colspan="2" class="table-header">
    <span class="table-header">Property Details</span></td>
</tr>
</table>
<a name="mask"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <h3 class="epydoc">mask</h3>
  Return mask_rho
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<a name="mask_psi"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <h3 class="epydoc">mask_psi</h3>
  Return mask_psi
  <dl class="fields">
    <dt>Get Method:</dt>
    <dd class="value"><span class="summary-sig"><a href="octant.grid.CGrid-class.html#_get_mask_psi" class="summary-sig-name" onclick="show_private();">_get_mask_psi</a>(<span class="summary-sig-arg">self</span>)</span>
    </dd>
  </dl>
</td></tr></table>
</div>
<a name="mask_u"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <h3 class="epydoc">mask_u</h3>
  Return mask_u
  <dl class="fields">
    <dt>Get Method:</dt>
    <dd class="value"><span class="summary-sig"><a href="octant.grid.CGrid-class.html#_get_mask_u" class="summary-sig-name" onclick="show_private();">_get_mask_u</a>(<span class="summary-sig-arg">self</span>)</span>
    </dd>
  </dl>
</td></tr></table>
</div>
<a name="mask_v"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <h3 class="epydoc">mask_v</h3>
  Return mask_v
  <dl class="fields">
    <dt>Get Method:</dt>
    <dd class="value"><span class="summary-sig"><a href="octant.grid.CGrid-class.html#_get_mask_v" class="summary-sig-name" onclick="show_private();">_get_mask_v</a>(<span class="summary-sig-arg">self</span>)</span>
    </dd>
  </dl>
</td></tr></table>
</div>
<a name="x"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <h3 class="epydoc">x</h3>
  Return x_vert
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<a name="y"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <h3 class="epydoc">y</h3>
  Return x_vert
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="octant-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1
    on Mon Apr 20 11:56:30 2009
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
